home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / arexx / uptime13.lha / Uptime / Uptime.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1994-12-02  |  844 b   |  36 lines

  1. /****** Uptime.rexx ************************************************************
  2. *
  3. *    $VER: Uptime 1.3 (2.12.94)  *  Copyright © 1993,94 Magnetic Ink
  4. *
  5. ********************************************************************************/
  6.  
  7. padStr    = "00"
  8.  
  9. nowDays    = DATE("I")
  10. nowSecs    = TIME("S")
  11.  
  12. envTime    = GETCLIP("Uptime")
  13.  
  14. IF envTime ~= "" THEN DO
  15.     envDays = WORD(envTime,1)
  16.     envSecs = WORD(envTime,2)
  17.     totDays = nowDays-envDays
  18.     totSecs = nowSecs-envSecs
  19.     DO WHILE totSecs < 0
  20.         totDays = totDays-1
  21.         totSecs = totSecs+86400
  22.     END
  23.     hh = padStr || totSecs % 3600
  24.     mm = padStr || (totSecs // 3600) % 60
  25.     dd = "day"
  26.     IF totDays ~= 1 THEN dd = dd || "s"
  27.     outLine = LEFT(TIME(),5) DELSTR(SPACE(DATE(),1,"-"),8,2)
  28.     SAY outLine " Up" totDays dd || "," RIGHT(hh,2) || ":" || RIGHT(mm,2)
  29. END
  30. ELSE CALL SETCLIP("Uptime",nowDays nowSecs)
  31. EXIT 0
  32.  
  33. /*
  34. **    EOF
  35. */
  36.